package com.suguowen.sblog.mapper;

import com.suguowen.sblog.bean.Article;
import com.suguowen.sblog.bean.User;
import com.suguowen.sblog.bean.UserExample;
import java.util.List;

import org.apache.ibatis.annotations.*;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    @Insert("insert into user (username, password) values(#{username},#{password})")
    @Options(useGeneratedKeys=true,keyProperty = "id", keyColumn = "id")
    int insertUser(User record);

    List<User> selectByExample(UserExample example);

    @Select("select id,username,password from user where username = #{name}")
    @Results({@Result(column="id",property="id"),
            @Result(column="username",property="username"),
            @Result(column="password",property="password"),
    })
    User selectOneByName(String name);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);
}